import React, { Component } from 'react'

export default class List extends Component {
    render() {
        const { list } = this.props
        return (
            <div>
                <h3>{list.length}</h3>
                <ul>
                    {list.map((item, index) =>
                        <li key={item.time}>
                            {item.name}
                            <button onClick={() => this.props.delItem(index)}>取消收藏</button>
                        </li>)}
                </ul>
            </div>
        )
    }
}
